@echo off
if not exist "..\mpi\Release\nfamin_mpi.exe" (echo ERROR: ..\mpi\Release\nfamin_mpi.exe not found
echo Please build project nfamin_mpi
goto :eof
)

for %%S in (3) do (call :run %%S kw ga)
goto :eof

:run
echo threads: %1
if not exist "..\res\%2\%3\mpi" @mkdir "..\res\%2\%3\mpi"
if exist "..\res\%2\%3\mpi\%1.%2.%3.mpi.txt" del "..\res\%2\%3\mpi\%1.%2.%3.mpi.txt"
"C:\MPICH2\bin\mpiexec.exe" -localonly -np %1 "..\mpi\Release\nfamin_mpi.exe" nfamin.ini ..\res\%2\%3\mpi > ..\res\%2\%3\mpi\%1.%2.%3.mpi.txt
pause